{include file="common/header"/}
<div class="lemo-container">
    <div class="lemo-main">
            <fieldset class="layui-elem-field layui-field-title">
                <legend>提现列表</legend>
                <blockquote class="layui-elem-quote">
                    <div class="lemo-table">
                        <div class="layui-inline">
                            <input type="text" id='rider_name' name="rider_name" lay-verify="required"
                                   placeholder="{:lang('pleaseEnter')}用户名称" autocomplete="off" class="layui-input">
                        </div>

                        <div class="layui-inline">
                            <input type="text" id='account_number' name="account_number" lay-verify="required"
                                   placeholder="{:lang('pleaseEnter')}提现账号" autocomplete="off" class="layui-input">
                        </div>

                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="start_time" id="start_time" placeholder="申请开始时间">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <input type="text" class="layui-input" name="end_time" id="end_time" placeholder="申请结束时间">
                            </div>
                        </div>
                        <a  href="javascript:;" class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="add" id="search">
                            {:lang('search')}
                        </a>
                    </div>
                </blockquote>
            </fieldset>
            <table class="layui-table" id="list" lay-filter="list"></table>
    </div>
</div>

<script type="text/html" id="action">
    {{# if(d.status==1){ }}
        <a  class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">通过</a>
        <a  class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">拒绝</a>
    {{# }else if( d.status==2){ }}
        <a  class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">通过</a>
        <a  class="layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled">拒绝</a>
    {{# }else{ }}
        <a data-href='{:url("examinewithdrawal")}' class="layui-btn layui-btn-xs" lay-event="adopt" data-type="1">通过</a>
        <a data-href='{:url("examinewithdrawal")}' class="layui-btn layui-btn-danger layui-btn-xs" lay-event="refuse" data-type="2">拒绝</a>
    {{# } }}
</script>

<script type="text/html" id="type">
    {{# if(d.type==1){ }}
    支付宝
    {{# }else if( d.type==2){ }}
    微信
    {{# }else{ }}
        银行卡
    {{# } }}
</script>

<script type="text/html" id="status">
    {{# if(d.status==1){ }}
        审核通过
    {{# }else if( d.status==2){ }}
        审核失败
    {{# }else{ }}
        等待审核
    {{# } }}
</script>
<!-- <script type="text/html" id="status">
    <input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" {{ d.rider_status == 1 ? 'checked' : '' }}>
</script> -->

<script type="text/html" id="create_time">
    {{layui.util.toDateString(d.create_time*1000, 'yyyy-MM-dd HH:mm:ss')}}
</script>


<script type="text/html" id="toolbar">
    <div class="layui-btn-container">

    </div>
</script>
{include file="common/footer"/}
<script>
    var tableIn = null;
    layui.config({
        base: "/static/admin/js/",
        version: true
    }).extend({
        Admin:'Admin',
    }).use(['table','Admin','laydate'], function () {
        var $ = layui.jquery,
            table = layui.table,
            laydate = layui.laydate;

        tableIn = table.render({
            elem: '#list',
            url: '{:url("withdrawalList")}',
            method: 'post',
            title: '骑手提现数据表',
            toolbar: '#toolbar', //开启头部工具栏，并为其绑定左侧模板

            defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '提示'
                ,layEvent: 'LAYTABLE_TIPS'
                ,icon: 'layui-icon-tips' }],
            cols: [[
                {checkbox: true, fixed: true},
                {field: 'id', title: 'ID', width: 80, fixed: true, sort: true},
                {field: 'withdrawal_no', title: '流水号', width: 200,},
                {field: 'nick_name', title: '用户姓名', width: 120, },
                {field: 'price', title: '提现金额', width: 100, },
                {field: 'account_name', title: '收款人姓名', width: 120},
                {field: 'account_number', title: '收款人账户', width: 160},
                {field: 'type', title: '收款类型', width: 120,templet:'#type'},
                {field: 'status', title: '审核状态', width: 120,templet:'#status'},
                {field: 'note', title: '拒绝原因', width: 200},
                {field: 'create_time', title: '申请时间', width: 180,templet:'#create_time'},
                {title:'操作',width:200, toolbar: '#action',align:"center"},

            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 15,
            page: true
        });

        //日期时间范围
        laydate.render({
           elem: '#start_time'
        });
        laydate.render({
           elem: '#end_time'
        });
    });

    //点击图片放大
    function showBigImage(e)
    {
        layer.open({
            type: 1,
            title: false,
            closeBtn: 0,
            shadeClose: true, //点击阴影关闭
            area: [$(e).width + 'px', $(e).height + 'px'], //宽高
            // area: ['600px', '400px'], //宽高
            content: "<img src=" + $(e).attr('src') + " />"
        });
    }

    //搜索
    $(document).on('click','#search',function(){
        var rider_name = $('#rider_name').val();
        var account_number = $('#account_number').val();
        var start_time = $('#start_time').val();
        var end_time = $('#end_time').val();
        // if(!$keys){
        //     return layer.msg('请输入关键词');
        // }
        tableIn.reload({ page: {page: 1},where: {rider_name: rider_name, account_number: account_number, start_time:start_time, end_time:end_time}});
    });
</script>